#version 460
#pragma vp_name VP Fragment Shader Main

// Fragment stage inputs:
in VP_PerVertex { 
    flat int oe_terrain_vertexMarker; 
    float atmos_space; 
    float oe_layer_opacity; 
    float oe_rex_morphFactor; 
    vec2 oe_layer_texc; 
    vec2 oe_layer_texcParent; 
    vec2 oe_normal_uv; 
    vec3 atmos_atten; 
    vec3 atmos_color; 
    vec3 atmos_lightDir; 
    vec3 atmos_up; 
    vec3 oe_UpVectorView; 
    vec3 oe_normal_binormal; 
    vec3 vp_Normal; 
    vec3 vp_VertexView; 
    vec4 oe_layer_tilec; 
    vec4 vp_Color; 
    vec4 vp_Vertex; 
} vp_in; 

// Fragment stage globals:
int oe_terrain_vertexMarker;
float atmos_space;
float oe_layer_opacity;
float oe_rex_morphFactor;
vec2 oe_layer_texc;
vec2 oe_layer_texcParent;
vec2 oe_normal_uv;
vec3 atmos_atten;
vec3 atmos_color;
vec3 atmos_lightDir;
vec3 atmos_up;
vec3 oe_UpVectorView;
vec3 oe_normal_binormal;
vec3 vp_Normal;
vec3 vp_VertexView;
vec4 oe_layer_tilec;
vec4 vp_Color;
vec4 vp_Vertex;

// Function declarations:
void oe_pbr_init(inout vec4 color); 
void oe_rex_normalMapFS(inout vec4 color); 
void oe_rex_imageLayer_FS(inout vec4 color); 
void myfunc_fragmentcoloring(inout vec4 color); 
void oe_VisibleLayer_setOpacity(inout vec4 color); 
void atmos_fragment_main(inout vec4 color); 
void myfunc_fragmentlighting(inout vec4 color); 
void myfunc_fragmentoutput(inout vec4 color); 

void main(void) 
{ 
    oe_terrain_vertexMarker = vp_in.oe_terrain_vertexMarker; 
    atmos_space = vp_in.atmos_space; 
    oe_layer_opacity = vp_in.oe_layer_opacity; 
    oe_rex_morphFactor = vp_in.oe_rex_morphFactor; 
    oe_layer_texc = vp_in.oe_layer_texc; 
    oe_layer_texcParent = vp_in.oe_layer_texcParent; 
    oe_normal_uv = vp_in.oe_normal_uv; 
    atmos_atten = vp_in.atmos_atten; 
    atmos_color = vp_in.atmos_color; 
    atmos_lightDir = vp_in.atmos_lightDir; 
    atmos_up = vp_in.atmos_up; 
    oe_UpVectorView = vp_in.oe_UpVectorView; 
    oe_normal_binormal = vp_in.oe_normal_binormal; 
    vp_Normal = vp_in.vp_Normal; 
    vp_VertexView = vp_in.vp_VertexView; 
    oe_layer_tilec = vp_in.oe_layer_tilec; 
    vp_Color = vp_in.vp_Color; 
    vp_Vertex = vp_in.vp_Vertex; 
    vp_Normal = normalize(vp_Normal); 
    oe_pbr_init( vp_Color ); 
    oe_rex_normalMapFS( vp_Color ); 
    oe_rex_imageLayer_FS( vp_Color ); 
    myfunc_fragmentcoloring( vp_Color ); ////////////////////////
    oe_VisibleLayer_setOpacity( vp_Color ); 
    atmos_fragment_main( vp_Color ); 
    myfunc_fragmentlighting( vp_Color ); /////////////////////////
    myfunc_fragmentoutput( vp_Color ); /////////////////////////
}